﻿<div ng-init="currentTab='news'" ng-include="'Views/Menu/NewsCalendarEventMenu.html'"></div>

<form name="newsEditForm" novalidate>
    <div class="title-bold" style="font-size: 16px; float: left; width: 60%; padding-right: 4%;">Edit News Item</div>
    <div class="title-bold" style="float: left; width: 40%;">Body of Article</div>
    <div class="clear"></div>
    <div style="float: left; width: 60%; padding-right: 4%;">
        <select name="newsCategory" class="select-box" style="width: 96%;" ng-model="newsEdit.newsData.category"
                ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2">
            <option value="null">News Category</option>
            <option ng-repeat="newsCategory in newsEdit.newsCategories" value="{{newsCategory.id}}">{{newsCategory.name}}</option>
        </select><br /><br />
        <div style="display: table; width: 99%;">
            <div class="table-row-inp">
                <div class="inp-label">
                    Article Title *
                </div>
                <div class="inp-holder">
                    <input name="newsTitle" type="text" class="inp" ng-model="newsEdit.newsData.title" required ng-maxlength="200"
                           ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2">
                </div>
            </div>
            <div class="table-spacer">&nbsp;</div>
            <div class="table-row-inp">
                <div class="inp-label">
                    Date *
                </div>
                <div class="inp-holder">
                    <input name="newsDateCreated" type="text" class="inp" datepicker-popup="MM/dd/yyyy" ng-model="newsEdit.newsData.dateCreated"
                           ng-required="true" ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2" />
                </div>
            </div>
            <div class="table-spacer">&nbsp;</div>
            <div class="table-row-inp">
                <div class="inp-label">
                    Tags
                </div>
                <div class="inp-holder">
                    <tags-input ng-model="newsEdit.newsData.tags" display-property="name" min-length="1"
                                ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2"></tags-input>
                </div>
            </div>
            <div class="table-spacer">&nbsp;</div>
            <div class="table-row-inp">
                <div class="inp-label">
                    Region *
                </div>
                <div class="inp-holder">
                    <select name="newsRegion" class="select-box" style="width: 95%;" ng-model="newsEdit.newsData.region" required
                            ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2">
                        <option value="">News Region</option>
                        <option ng-repeat="newsRegion in newsEdit.newsRegions" value="{{newsRegion.id}}">{{newsRegion.name}}</option>
                    </select>
                </div>
            </div>
            <div class="table-spacer">&nbsp;</div>
            <div class="table-row-inp">
                <div class="inp-label">
                    Unpublished Date *
                </div>
                <div class="inp-holder">
                    <input name="newsUnpublishedDate" type="text" class="inp" datepicker-popup="MM/dd/yyyy"
                           ng-model="newsEdit.newsData.unpublishedDate" ng-required="true" 
                           ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2" />
                </div>
            </div>
            <div class="table-spacer">&nbsp;</div>
        </div><br />
        <div class="title-bold">Available for:</div>
        <div style="display: table; width: 99%;">
            <div class="table-row-inp">
                <div class="inp-label">
                    Choose One
                </div>
                <div class="inp-holder">
                    <div style="float: left; padding-right: 10px;" ng-repeat="newsAvailability in newsEdit.newsAvailabilities">
                        <input type="radio" name="radiog_lite" id="radio{{$index}}" class="css-checkbox" checked="checked"
                               ng-value="newsAvailability.id" ng-model="newsEdit.newsData.availableFor"
                               ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2" />
                        <label for="radio{{$index}}" class="css-label radGroup1">{{newsAvailability.name}}</label>
                    </div>
                    <div class="clear">&nbsp;</div>
                </div>
            </div>
        </div><br /><br />
        <button class="btn-green" style="width: 151px; margin-right: 10px;" ng-click="newsEdit.publish();" ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2">Publish</button>
        <button class="btn-green" style="margin-right: 10px;" ng-click="newsEdit.saveAndContinue();" ng-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2">Save as Draft</button>
        <button class="btn-green" style="width: 151px;" ng-click="newsEdit.cancel();">Cancel</button>
    </div>
    <div style="float: left; width: 40%;">
        <div id="newsBody" name="newsBody" required class="editor-field" text-angular ng-model="newsEdit.newsData.body" required
             ta-toolbar="[['h1','h2','h3'],['bold','italics','underline'],['insertLink'],['html']]"
             ta-disabled="newsEdit.newsData.status === 1 || newsEdit.newsData.status === 2"></div>
    </div>
    <div class="clear">&nbsp;</div>
</form>